<template>
  <div>
    <djwzbs
      v-for="(item, index) in arr"
      :key="index"
      v-bind="{ src: item.dogImgUrl, desc: item.dogName }"
      @selectDog="selectDog"
    />
    <div>
      <p>你喜欢的狗如下</p>
      <ul>
        <li v-for="(item, index) in dogs" :key="index">{{ item }}</li>
      </ul>
    </div>
  </div>
</template>

<script>
import Djwzbs from './djwzbs.vue'
export default {
  name: 'Xzxhdg',
  components: {
    Djwzbs,
  },
  data() {
    return {
      arr: [
        {
          dogImgUrl:
            'http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg',
          dogName: '博美',
        },
        {
          dogImgUrl:
            'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1224576619,1307855467&fm=26&gp=0.jpg',
          dogName: '泰迪',
        },
        {
          dogImgUrl:
            'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2967740259,1518632757&fm=26&gp=0.jpg',
          dogName: '金毛',
        },
        {
          dogImgUrl:
            'https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c',
          dogName: '哈士奇',
        },
        {
          dogImgUrl:
            'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F11523224337%2F0.jpg&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1634023913&t=340cf8af15cd7b7d7dbd62e541760ff2',
          dogName: '阿拉斯加',
        },
        {
          dogImgUrl:
            'https://img0.baidu.com/it/u=1128363330,122474811&fm=26&fmt=auto&gp=0.jpg',
          dogName: '萨摩耶',
        },
      ],
      dogs: [],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    selectDog(dogName) {
      this.dogs.push(dogName)
    },
  },
}
</script>

<style lang="less" scoped></style>
